the729 / go-libra Goto Github PK
View Code? Open in Web Editor NEWLibra go client library with crypto verifications
License: Apache License 2.0
Libra go client library with crypto verifications
License: Apache License 2.0
It's a good choice to add a wallet package and related functions such as newWallet
, wallet.createAccount
, and more such as client.mintCoin
.
Moreover, adding a wallet also tackles the problem of the differentiation of ed25519
between golang and rust.
In golang, there is 64-bytes private key, whereas the libra uses 32-bytes private key (called PrivateKeySeed in golang). The private key generated from libra source code that can't be used directly to go-libra package because of the difference of key length.
To eliminate the ambiguities, the choices are either to add wallet operations in golang package that would use golang's ed25519 or support the 32-bytes length private key from rust or other analogous programming languages that only produce 32-bytes private key by declaring a function like ed25519.NewKeyFromSeed()
.
New to golang, so installation instructions would be helpful. After installing golang, from the command line enter: 'go get github.com/the729/go-libra/...' The executables will be placed in $GOPATH/bin/, and when running the executable it needs a copy of the file 'trusted_peers.config.toml' to be in the parent directory, (../trusted_peers.config.toml).
The newest gopherjs-libra lib errors as Error: rpc error: code = Unknown desc = Response closed without headers
with the example
folders code and the server http://hk2.wutj.info:38080
, while the go-libra performs as well.
The example node server http://hk2.wutj.info:38080
has worked as well, while my libra-swarm node server I'm trying to connect was failed.
The connect point of the libra-cli to the swarm node is http://34.223.183.142:8000
.
Errors below:
Error: rpc error: code = Unknown desc = Response closed without headers
How's the difference between them?
I'm using HTTP/2 protocol.
Currently, the genesis hash is hard coded:
genesisHash, _ := hex.DecodeString("b7712506940af39e57de4a868c15849ab09bd8e3c4a89113a492797c6f98bf6b")
I think the genesisHash is represented as libra testnet genesis hash.
Are there any options for replacing it to a customized local node hash, not the libra testnet hash?
With the rpc error message once running example tests on both go and gopher-js.
Is there a possible way to implement the type definition of gopherjs-libra to work with typescript?
I see such .d.ts
generator dts-gen
from microsoft can help to generate d.ts file from node or js library.
There is the generated d.ts file from gopherjs-libra.js.
/** Declaration file generated by dts-gen */
export = gopherjs_libra;
declare const gopherjs_libra: {
libra: {
accountReceivedEventPath: any;
accountResourcePath: any;
accountSentEventPath: any;
client: any;
inferProgramName: any;
pubkeyToAddress: any;
resourcePath: any;
};
};
However, the origin javascript file need to be a module (translate to ts file) or exported. I'm trying to implement that at this time.
We're considering to develop a new Libra IDE for enabling contract capabilities. However I didn't see there is a SDK to support that functioning as well.
Well I think this repo is maintained as so good as sticking with the latest libra testnet, and can be used as frontend javascript library. Therefore, we want to contribute about the move contract interaction code to this repo to enabling that capabilities, not just peer-to-peer-transactions.
Retrieve a waypoint form https://developers.libra.org/testnet_waypoint.txt .
see libra#2425
I've tried to make the RotateKeys function working, but there seems to be problems regarding the passing of byte arrays. This is what I tried to pass as the payload of a raw transaction (key is a []byte
slice):
payload := &types.TxnPayloadScript{
Code: stdscript.RotateAuthKey,
Args: []types.TransactionArgument{
types.TxnArgBytes(key),
},
}
Could you try to verify if RotateKeys is working for you or the problem is related to libra core?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.