Block Chain Technology and Investments Buzz for Beginners

Discuss Blockchain Technology Platform, Crypto Currencies, ICO's, ETF's, NFT's and more...

Crypto Stocks/ETFs

Funds that invest in companies involved in development and use of blockchain technology or Futures contracts that track the performance of cryptocurrencies or holding the underlying crypto-assets.

Start a Bitcoin full node on your computer (Supported OS : Linux, Mac, BSD, Windows)

$ curl https://bitnodes.io/install-full-node.sh | sh

Hyperledger Smart Contract for Private loans


// loan_chaincode.go

package main

import (
	"fmt"
	"github.com/hyperledger/fabric-contract-api-go/contractapi"
)

// LoanContract represents the smart contract
type LoanContract struct {
	contractapi.Contract
}

// Loan represents a loan transaction
type Loan struct {
	ID        string `json:"id"`
	Borrower  string `json:"borrower"`
	Lender    string `json:"lender"`
	Amount    int    `json:"amount"`
	Repaid    bool   `json:"repaid"`
}

// Init initializes the chaincode
func (lc *LoanContract) Init(ctx contractapi.TransactionContextInterface) error {
	fmt.Println("Chaincode initialized")
	return nil
}

// RequestLoan creates a new loan request
func (lc *LoanContract) RequestLoan(ctx contractapi.TransactionContextInterface, id string, borrower string, lender string, amount int) error {
	existing, err := ctx.GetStub().GetState(id)
	if err != nil {
		return fmt.Errorf("Failed to get loan: %v", err)
	}

	if existing != nil {
		return fmt.Errorf("Loan with ID %s already exists", id)
	}

	loan := Loan{
		ID:       id,
		Borrower: borrower,
		Lender:   lender,
		Amount:   amount,
		Repaid:   false,
	}

	loanJSON, err := serialize(loan)
	if err != nil {
		return err
	}

	err = ctx.GetStub().PutState(id, loanJSON)
	if err != nil {
		return fmt.Errorf("Failed to put loan into ledger: %v", err)
	}

	return nil
}

// RepayLoan marks the loan as repaid
func (lc *LoanContract) RepayLoan(ctx contractapi.TransactionContextInterface, id string) error {
	loanJSON, err := ctx.GetStub().GetState(id)
	if err != nil {
		return fmt.Errorf("Failed to read loan: %v", err)
	}

	if loanJSON == nil {
		return fmt.Errorf("Loan with ID %s does not exist", id)
	}

	var loan Loan
	err = deserialize(loanJSON, &loan)
	if err != nil {
		return err
	}

	loan.Repaid = true

	loanJSON, err = serialize(loan)
	if err != nil {
		return err
	}

	err = ctx.GetStub().PutState(id, loanJSON)
	if err != nil {
		return fmt.Errorf("Failed to update loan: %v", err)
	}

	return nil
}

// QueryLoan retrieves loan details by ID
func (lc *LoanContract) QueryLoan(ctx contractapi.TransactionContextInterface, id string) (*Loan, error) {
	loanJSON, err := ctx.GetStub().GetState(id)
	if err != nil {
		return nil, fmt.Errorf("Failed to read loan: %v", err)
	}

	if loanJSON == nil {
		return nil, fmt.Errorf("Loan with ID %s does not exist", id)
	}

	var loan Loan
	err = deserialize(loanJSON, &loan)
	if err != nil {
		return nil, err
	}

	return &loan, nil
}

// serialize converts struct to JSON
func serialize(data interface{}) ([]byte, error) {
	return json.Marshal(data)
}

// deserialize converts JSON to struct
func deserialize(data []byte, result interface{}) error {
	return json.Unmarshal(data, result)
}

func main() {
	loanContract := new(LoanContract)
	chaincode, err := contractapi.NewChaincode(loanContract)
	if err != nil {
		fmt.Printf("Error creating loan chaincode: %s", err.Error())
		return
	}

	if err := chaincode.Start(); err != nil {
		fmt.Printf("Error starting loan chaincode: %s", err.Error())
	}
}
Install and Instantiate Chaincode: Follow the Hyperledger Fabric documentation to package, install, and instantiate the chaincode. 

Client Application: Create an HTML page or another application to interact with the chaincode. This can be done using the Hyperledger Fabric SDK for your preferred programming language. This example provides a basic structure for a private loan transactions chaincode in Hyperledger Fabric. You may need to adjust the code based on your specific requirements, security considerations, and network setup.

Disney Co. chose Polygon as blockchain-native platform.

Polygon is selected to participate in Disney's 2022 Accelerator program, according to a statement made by Disney on Wednesday. Polygon's native token, MATIC surges.

Chipotle use Flexa to accept the CryptoCurrencies

Flexa (https://flexa.network/) is a digital payment platform used by Chipotle to accept the crypto currencies.  Customers will need to download SPEDN or Gemini app to use Flexa.  Flexa supports around 98 crypto currencies.  

Flexa use SPEND SDK to unlock instant payments.

Bitcoin Crashing - A Domino Effect

Unwinding and Liquidation stemming from the UST/LUNA unwind.


Are you a Photographer or an Artist? Try these simple steps to create your first NFT in OpenSea.

   
    1) Create Metamask account 


    2) Create Opensea Account
    3) Upload the picture in Opensea.   

    4) List the picture for Sale in Opensea.io (Choose Polygon Blockchain for free listing)
    
    5) Check the NFT in OpenSea. 



There was an error with your transaction. Please try again

Open Sea Error -  There was an error with your transaction.  Please try again

How to fix the error?
  1. Refresh the MetaMask Account
  2. Disable the popup blockers
  3. Disable Antivirus blocking OpenSea
  4. Disable AdBlocker
  5. Try in different Browser