NAME

Circle::Node - The great new Circle::Node!

VERSION

Version 0.01

SYNOPSIS

Quick summary of what the module does.

Perhaps a little code snippet.

use Circle::Node;

my $foo = Circle::Node->new();
...

EXPORT

A list of functions that can be exported. You can delete this section if you don't export anything, such as for a purely object-oriented module.

SUBROUTINES/METHODS

subscribe

my $response = subscribe();
if ($response->{status} == 200) {
   my $data = $response->{data};
   # process data here.
}

subscribe the circle chain server node and get the basic data of the node:

{
  "baseHeight": 1000,
  "ipPortList": ["123.34.33.16:80"]
}

serverFeatures

my $response = serverFeatures();
if ($response->{status} == 200) {
  my $data = $response->{data};
  # process the data here.
}

serverFeatures api provides the server features:

{
  "version": "1.0.0",
  "role": "CLOUDER",
  "protolVersion": "0.0.1",
  "publicIP": "123.32.22.12",
  "localIP": "192.168.1.10",
  "port": 80,
  "baseHeight": 1000,
  "publicKey": null
}

broadcastTransaction

my $response = broadcastTransaction({
  txid => '',
  type => 0,
  hash => '',
  version => 1,
  size => 100,
  vsize => 100,
  weight => 0,
  locktime => 0,
  vin => [
    {
      txid => '',
      vout => 0,
      scriptSig => {
        asm => '',
        hex => '',
      },
      txinwitness => [],
      sequence => 0,
      addresses => [''],
      value => '',
    }
  ],
  vout => [
    {
      value => '',
      n => 0,
      scriptPubKey => '',
    }
  ],
  blockhash => '',
  confirmations => 1,
  time => 1725885098000,
  blocktime => 1725887098000
});
if ($response->{status} == 200) {
  my $txid = $response->{data};
  # the transaction is broadcast.
}

AUTHOR

charles li, <lidh04 at gmail.com>

BUGS

Please report any bugs or feature requests to bug-circle-node at rt.cpan.org, or through the web interface at https://rt.cpan.org/NoAuth/ReportBug.html?Queue=Circle-Node. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes.

SUPPORT

You can find documentation for this module with the perldoc command.

perldoc Circle::Node

You can also look for information at:

ACKNOWLEDGEMENTS

LICENSE AND COPYRIGHT

This software is Copyright (c) 2024 by charles li.

This is free software, licensed under:

The Artistic License 2.0 (GPL Compatible)