Comments (22)
Ok, let me review. Probably won't get to it until later this evening.
from vault-ethereum.
@cypherhat The official vault docker image is based off this OS:
https://alpinelinux.org FYI
from vault-ethereum.
Due to the difference in the libraries between glibc and musl I recompiled in the docker file and seem to have got it working.
For reference is my new vault docker file:
FROM vault:latest
# Install build tools
RUN apk add --update alpine-sdk
# Make new directory for plugins
RUN mkdir /vault/plugins
# Download and compile Ethereum plugin
RUN apk update \
&& apk add go git
RUN go get github.com/immutability-io/vault-ethereum \
&& go build github.com/immutability-io/vault-ethereum
RUN mv /root/go/bin/vault-ethereum /vault/plugins/vault-etheruem
from vault-ethereum.
After some help from https://github.com/sirlatrom on the docker community slack, he determined because the base vault docker image uses alpine which uses musl and the plugin needs glibc it failed.
I then updated my vault dockerfile to install the following:
https://github.com/sgerrand/alpine-pkg-glibc
The error now is
Error enabling: Error making API request.
URL: POST http://192.168.1.60:9200/v1/sys/mounts/ethereum
Code: 400. Errors:
* plugin exited before we could connect
from vault-ethereum.
What does your vault config look like? Specifically, is api_addr set?
from vault-ethereum.
My vault config (on Darwin) looks like this. Note: I am using TLS to talk to vault:
"default_lease_ttl" = "24h"
"max_lease_ttl" = "24h"
"backend" "file" {
"path" = "/Users/immutability/etc/vault.d/data"
}
"api_addr" = "https://localhost:8200"
"listener" "tcp" {
"address" = "localhost:8200"
"tls_cert_file" = "/Users/immutability/etc/vault.d/vault.crt"
"tls_client_ca_file" = "/Users/immutability/etc/vault.d/root.crt"
"tls_key_file" = "/Users/immutability/etc/vault.d/vault.key"
}
"plugin_directory" = "/Users/immutability/etc/vault.d/vault_plugins"
from vault-ethereum.
{ "api_addr":"http://127.0.0.1:8200", "plugin_directory":"/vault/plugins", "backend":{ "consul":{ "scheme":"http", "address":"192.168.1.60:9500", "advertise_addr":"http://192.168.1.60", "path":"vault/" } }, "listener":{ "tcp":{ "address":"0.0.0.0:8200", "tls_disable":"true" } } }
That is exactly the config that is running. If I use postman to interact with the API publically. I get the same error message:
POST /sys/mounts/ethereum
{
"type": "plugin",
"config": {
"force_no_cache": true
},
"plugin_name": "ethereum-plugin"
}
Response:
{
"errors": [
"plugin exited before we could connect"
]
}
from vault-ethereum.
@cypherhat Is there anywhere I can see more verbose errors to try and debug?
from vault-ethereum.
Here is the output of ldd /vault/plugins/vault-ethereum
/lib64/ld-linux-x86-64.so.2 (0x7f0661440000)
libpthread.so.0 => /lib64/ld-linux-x86-64.so.2 (0x7f0661440000)
libc.so.6 => /lib64/ld-linux-x86-64.so.2 (0x7f0661440000)
Error relocating /vault/plugins/vault-ethereum: __fprintf_chk: symbol not found
from vault-ethereum.
I am in the last stages of testing a release for the new go-ethereum release (Iceberg). I will cut a Darwin and Ubuntu-tested Linux build of that; then, I will start testing this on the official vault docker image. I apologize for the delay - I use a Xenial-based Vagrant box for testing the plugin rather than a Docker environment.
from vault-ethereum.
I think I need to build from source on Alpine, can you provide instructions on how to do this with Make or go build.
Unfamiliar with both of these and I thought go build needs a src directory
from vault-ethereum.
I meant to return to this. Apologies.
Can you PR your Dockerfile? That way we can let others work from the official Docker image. Thanks!
from vault-ethereum.
Where would you like the Dockerfile? Also I'm still not up and running yet. Currently have this error:
vault write ethereum/accounts/test chain_id=1977 rpc_url=http://192.168.1.60:8545
Error writing data to ethereum/accounts/test: Error making API request.
URL: PUT http://192.168.1.60:9200/v1/ethereum/accounts/test
Code: 500. Errors:
* 1 error occurred:
* unexpected EOF
I've confirmed that from the Vault container I can create ethereum accounts via the JSON RPC:
curl 192.168.1.60:8545 -X POST --data '{"jsonrpc":"2.0","method":"personal_newAccount","params":["********"],"id":1}'
-H "Content-Type: application/json"
{"jsonrpc":"2.0","id":1,"result":"0x589f9ae1df19d051661ee27b3c937269b62ddd6a"}
Any idea how to debug?
from vault-ethereum.
You can put it in the root directory of the repo. As regards your error, the plugin doesn't talk to the Ethereum node to create an account, so it is something related to Vault-Plugin communication most likely. I can give it a try this weekend - I had thought you had success.
from vault-ethereum.
Closing due to lack of activity.
from vault-ethereum.
According to @jefferai here: hashicorp/vault#3417
plugins should be built with CGO_ENABLED=0
from vault-ethereum.
@zambien this makes the build fail with:
go build github.com/ethereum/go-ethereum/crypto/secp256k1: build constraints exclude all Go files in /go/pkg/mod/github.com/ethereum/[email protected]/crypto/secp256k1
# github.com/ethereum/go-ethereum/rpc
/go/pkg/mod/github.com/ethereum/[email protected]/rpc/endpoints.go:96:19: undefined: ipcListen
/go/pkg/mod/github.com/ethereum/[email protected]/rpc/ipc.go:50:10: undefined: newIPCConnection
from vault-ethereum.
@JBunCE, yep. Sorry about that. I forgot I had posted this here. The right way to handle this is to use some other means of cross-compilation if that is what you are going for (for example, compiling darwin in linux).
You can use xgo for this:
https://github.com/techknowlogick/xgo
Although perhaps that isn't maintained anymore so use [email protected]:techknowlogick/xgo.git.
The following will work assuming the following:
- must compile OUTSIDE of GOPATH
- must clear vendor folder
For example:
# get/build xgo with vendoring support
go get github.com/techknowlogick/xgo
cd $GOPATH/src/github.com/techknowlogick/xgo
go build .
# build with xgo
cd /tmp
git clone [email protected]:immutability-io/vault-ethereum.git
cd vault-ethereum
rm -rf vendor
$GOPATH/src/github.com/techknowlogick/xgo/xgo -out vault-ethereum --targets=darwin/amd64,linux/amd64,windows/amd64 -deps=https://gmplib.org/download/gmp/gmp-6.0.0a.tar.bz2 .
Perhaps a better approach would be to use goreleaser cross-compilation but I haven't looked into that yet.
https://medium.com/@robdefeo/cross-compile-with-cgo-and-goreleaser-6af884731222
from vault-ethereum.
In order to resolve this I'd like to recommend the following:
- We move this repo to use goreleaser.
- We use the goreleaser-xcgo library for cross compilation
Anyone have issues with this?
from vault-ethereum.
Please PR. I'll approve.
This plugin is long overdue for a re-factor. I want to provide a way to allow smart contracts to be more elegantly integrated. Working on this...
from vault-ethereum.
As far as the initial issue, this blog explains the problem and the solution:
http://kefblog.com/2017-07-04/Golang-ang-docker
I'll include this in a PR shortly.
from vault-ethereum.
As far as the initial issue, this blog explains the problem and the solution:
FYI link changed to https://kefblog.com/Post/2017-07-04_golang-in-docker-without-disabling-cgo-on-alpine
from vault-ethereum.
Related Issues (20)
- Unable to use Self Signed Certificate
- Can we save string data inside ethereum HOT 1
- How to pass hex string data to sign-tx HOT 7
- Finding Logs for the ethereum plugin HOT 3
- Error when installing vault-ethereum plugin HOT 9
- Error in path_blocks.go HOT 1
- Feature questions: importing ABI, filtering, and logging HOT 2
- Unrecognized remote plugin message HOT 15
- Error writing data to ethereum-plugin/config: Error making API request. HOT 2
- Error when setting config HOT 1
- When "address_to" is not mentioned during the transaction signing, the funds are transferred to NULL address. HOT 1
- Can I use vault plugin for quorum? HOT 1
- unusable message signing (ethereum/accounts/:name/sign and ethereum/accounts/:name/verify) HOT 9
- unable to install
- sign-tx function sign transaction incorrectly.
- Sign message & verify signed message are not working properly HOT 1
- Unable to modify gas_limit parameter on sign-tx request HOT 1
- Curl not working properly for Erc20, Erc721 HOT 1
- How to backup data
- Unable to enable secrets path using newer version of Vault and ethereum plugin binary
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from vault-ethereum.