Giter Club home page Giter Club logo

go-libdogecoin's Introduction

go-libdogecoin

This repository is under construction! Once completed, this will be a go module implementing the libdogecoin interface retrievable with go get.

go-libdogecoin's People

Contributors

jaxlotl avatar

Stargazers

ignoxx avatar Frank avatar Paulo Vidal avatar Timothy Stebbing avatar

Watchers

 avatar

Forkers

xanimo dogeorg

go-libdogecoin's Issues

Error when using go to call go-libdogecoin

The system is macos 12.0.1, intel cpu

Here is my code

`package main

import (
"fmt"
"github.com/jaxlotl/go-libdogecoin"
)

func main() {
prev_output_txid_2 := "b4455e7b7b7acb51fb6feba7a2702c42a5100f61f61abafa31851ed6ae076074" // worth 2 dogecoin
prev_output_txid_10 := "42113bdc65fc2943cf0359ea1a24ced0b6b0b5290db4c63a3329c6601c4616e2" // worth 10 dogecoin
prev_output_n_2 := 1
prev_output_n_10 := 1
external_address := "nbGfXLskPh7eM1iG5zz5EfDkkNTo9TRmde"
my_address := "noxKJyGPugPRN4wqvrwsrtYXuQCk7yQEsy"
my_script_pubkey := "76a914d8c43e6f68ca4ea1e9b93da2d1e3a95118fa4a7c88ac"
my_privkey := "ci5prbqz7jXyFPVWKkHhPq4a9N8Dag3TpeRfuqqC2Nfr7gSqx1fy"

index := libdogecoin.W_start_transaction()
defer libdogecoin.W_clear_transaction(index)
libdogecoin.W_add_utxo(index, prev_output_txid_2, prev_output_n_2)
libdogecoin.W_add_utxo(index, prev_output_txid_10, prev_output_n_10)
libdogecoin.W_add_output(index, external_address, "5.0")
libdogecoin.W_finalize_transaction(index, external_address, "0.00226", "12.0", my_address)

// sign both inputs of the current finalized transaction
if libdogecoin.W_sign_transaction(index, []string{"2", "10"}, my_script_pubkey, my_privkey) != 1 {
	fmt.Println("!=1")
}
// error handling here
fmt.Println("The final signed transaction hex is:", libdogecoin.W_get_raw_transaction(index))

}`

The following error occurs when running the code

# testDogeCoin /usr/local/go1.19.8/go/pkg/tool/darwin_amd64/link: running clang failed: exit status 1 ld: warning: ignoring file /Users/xiaodong/go/pkg/mod/github.com/jaxlotl/[email protected]/build/darwin/amd64/libdogecoin.a, building for macOS-x86_64 but attempting to link with file built for unknown-unsupported file format ( 0x21 0x3C 0x61 0x72 0x63 0x68 0x3E 0x0A 0x2F 0x20 0x20 0x20 0x20 0x20 0x20 0x20 ) Undefined symbols for architecture x86_64: "_add_output", referenced from: __cgo_fe3e5889e15c_Cfunc_add_output in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_add_output) "_add_utxo", referenced from: __cgo_fe3e5889e15c_Cfunc_add_utxo in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_add_utxo) "_clear_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_clear_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_clear_transaction) "_dogecoin_ecc_start", referenced from: __cgo_fe3e5889e15c_Cfunc_dogecoin_ecc_start in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_dogecoin_ecc_start) "_dogecoin_ecc_stop", referenced from: __cgo_fe3e5889e15c_Cfunc_dogecoin_ecc_stop in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_dogecoin_ecc_stop) "_finalize_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_finalize_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_finalize_transaction) "_generateDerivedHDPubkey", referenced from: __cgo_fe3e5889e15c_Cfunc_generateDerivedHDPubkey in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_generateDerivedHDPubkey) "_generateHDMasterPubKeypair", referenced from: __cgo_fe3e5889e15c_Cfunc_generateHDMasterPubKeypair in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_generateHDMasterPubKeypair) "_generatePrivPubKeypair", referenced from: __cgo_fe3e5889e15c_Cfunc_generatePrivPubKeypair in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_generatePrivPubKeypair) "_get_raw_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_get_raw_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_get_raw_transaction) "_sign_raw_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_sign_raw_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_sign_raw_transaction) "_sign_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_sign_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_sign_transaction) "_start_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_start_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_start_transaction) "_store_raw_transaction", referenced from: __cgo_fe3e5889e15c_Cfunc_store_raw_transaction in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_store_raw_transaction) "_verifyHDMasterPubKeypair", referenced from: __cgo_fe3e5889e15c_Cfunc_verifyHDMasterPubKeypair in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_verifyHDMasterPubKeypair) "_verifyP2pkhAddress", referenced from: __cgo_fe3e5889e15c_Cfunc_verifyP2pkhAddress in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_verifyP2pkhAddress) "_verifyPrivPubKeypair", referenced from: __cgo_fe3e5889e15c_Cfunc_verifyPrivPubKeypair in 000001.o (maybe you meant: __cgo_fe3e5889e15c_Cfunc_verifyPrivPubKeypair) ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.